<script type="text/javascript">
	$(document).ready(function(){
		$.validator.messages.required = "";
		$.validator.messages.date = "";
		$("#FormSua").validate();
	});
</script>
<?php
	// Lấy mã sách từ thanh địa chỉ
	$MaHocSinh = $_GET['mhs'];
	$MaMonHoc = $_GET['mmh'];
	
	$diemhk = new diemhkbs();
	$diemhk->MaHocSinh = $MaHocSinh;
	$diemhk->MaMonHoc = $MaMonHoc;
	
	$danhsach = $diemhk->GetList();
?>
<h3>Sửa điểm <?php echo $danhsach[0]['TenMonHoc']; ?> </h3>
<form id="FormSua" action="index.php?do=diemhk_sua_xuly" method="post">
	<input type="hidden" value="<?php echo $MaHocSinh; ?>" name="MaHocSinh" />
    <input type="hidden" value="<?php echo $MaMonHoc; ?>" name="MaMonHoc" />
 	<table class="Form">
		<tr>
			<td>Năm học:</td>
			<td>
            <select name="NamHoc" class="required">
			<?php
				$namhoc = new namhocbs();
				$dmnamhoc = $namhoc->GetListNamHoc();
				
				for($i = 0; $i < count($dmnamhoc); $i++)
				{       
					if($dmnamhoc[$i]['NamHoc'] == $danhsach[0]['NamHoc'])
						echo "<option value='{$dmnamhoc[$i]['NamHoc']}' selected='selected' >{$dmnamhoc[$i]['NamHoc']}</option>";
					else
						echo "<option value='{$dmnamhoc[$i]['NamHoc']}'>{$dmnamhoc[$i]['NamHoc']}</option>";
				}
			?>
            </select>
                <span class="requirefield">*</span></td>
		</tr>
        <tr>
			<td>Học kỳ:</td>
			<td>
            <select name="HocKy" class="required">
			<?php
				$namhoc1 = new namhocbs();
				$dmnamhoc1 = $namhoc1->GetList();
				
				for($i = 0; $i < count($dmnamhoc1); $i++)
				{       
					if($dmnamhoc1[$i]['HocKy'] == $danhsach[0]['HocKy'])
						echo "<option value='{$dmnamhoc1[$i]['HocKy']}' selected='selected'>{$dmnamhoc1[$i]['HocKy']}</option>";
					else
						echo "<option value='{$dmnamhoc1[$i]['HocKy']}'>{$dmnamhoc1[$i]['HocKy']}</option>";
				}
			?>
            </select>
                <span class="requirefield">*</span></td>
		</tr>
        <tr>
			<td>Kiểm tra một:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['KiemTra_Mot']; ?>" name="KiemTra_Mot" /><span class="requirefield">*</span></td>
		</tr>
        <tr>
			<td>Kiểm tra hai:</td>
			<td><input class="required"  type="text" value="<?php echo $danhsach[0]['KiemTra_Hai']; ?>" name="KiemTra_Hai" /><span class="requirefield">*</span></td>
		</tr>
		 <?php if($danhsach[0]['ThiLai'] == 0) 
			{
				echo'<tr>
				<td>Kiểm tra ba:</td>
				<td><input class="required" type="text" value="'.$danhsach[0]['KiemTra_Ba'].'" name="KiemTra_Ba" /><span class="requirefield">*</span></td>
			</tr>';
			}else
			{
				echo ' <input type="hidden" value="'.$danhsach[0]['KiemTra_Ba'].'" name="KiemTra_Ba" />';
			}
		?>
	</table>
	<p class="GhiChuBatBuoc">(*): Trường bắt buộc phải nhập thông tin.</p>
	<input type="submit" value="Cập nhật vào CSDL" />
</form>
